import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import user from './modules/user'
import tagsView from './modules/tagsView'
import permission from './modules/permission'
import settings from './modules/settings'
import goodsDetail from './modules/goodsDetail'
import dianUser from './modules/dianUser'
import getters from './getters'
import createPersistedState from "vuex-persistedstate";

Vue.use(Vuex)

//会话关掉,数据清空
const vuexSession = createPersistedState(
  {
    key: 'store-client',
    storage: window.sessionStorage,
    paths: ['dianUser','goodsDetail']
  })

const store = new Vuex.Store({
  modules: {
    app,
    user,
    tagsView,
    permission,
    settings,
    goodsDetail,
    dianUser
  },
  getters,
    // 配置插件
   plugins: [vuexSession]
})

export default store
